/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 *
 *  17, November, 2011. Creation date.
 */

package portfolio.dbHost.dataBases;

//import com.mysql.jdbc.Connection;
import portfolio.dbHost.Host;

/**
 *
 * @author aca ldero
 */
public class DBaseFactory {

    public DBase getDBType (Host hostDBParam) throws Exception
    {
        if (hostDBParam.getDBType() == Host.DB_TYPE_MYSQL) {
            return new MysqlDBase (hostDBParam);
        } else if (hostDBParam.getDBType() == Host.DB_TYPE_ODBC) {
            return new OdbcDBase (hostDBParam);
        } else {
            throw new Exception ("DB type unknown while trying to create Column.");
        }
    }
    /**
     *
     *
     *
     */
    public DBase getDBType (Host hostDBParam, String sDBNameParam) throws Exception
    {
        if (hostDBParam.getDBType() == Host.DB_TYPE_MYSQL) {
            return new MysqlDBase (hostDBParam);
        } else if (hostDBParam.getDBType() == Host.DB_TYPE_ODBC) {
            return new OdbcDBase (hostDBParam);
        } else {
            throw new Exception ("DB type unknown while trying to create Column.");
        }
    }

}
